package com.xuzz.study.spring.schema;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;

public class StudentNamespaceHandler extends NamespaceHandlerSupport {
    @Override
    public void init() {
        System.out.println("StudentNamespaceHandler的parse方法init方法里注册parser");
        registerBeanDefinitionParser("student",new StudentBeanDefinitionParser());
    }

    @Override
    public BeanDefinition parse(Element element, ParserContext parserContext) {
        System.out.println("StudentNamespaceHandler的parse方法");
        return super.parse(element, parserContext);
    }
}
